package proxy;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;

public class FiltersManager {
	public ArrayList<String> hostsBlocked = new ArrayList<String>(); 
	private static FiltersManager singleton = new FiltersManager();
	
	private FiltersManager(){
		BufferedReader reader;
		try {
			reader = new BufferedReader(new FileReader("Filter_host.txt"));
			String line;
			
			while((line = reader.readLine()) != null){
				hostsBlocked.add(new String(line));
			}
			
			reader.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public boolean isHostBlocked(String host){
		return hostsBlocked.contains(host);
	}
	
	public static FiltersManager getFilterManager(){
		return singleton;
	}
}
